%
% Author: Vasyl Mykhalchuk
% 01/02/2012
%
function [v] = getClosestVert( unvis, dist )

n = size(unvis, 2);
distV = Inf;
v = -1;
for i = 1 : n
    if ( unvis(i) == 1 )
        if ( distV > dist(i) )
            v = i;
            distV = dist(i);
        end % if
    end % if
end % for

end % function